



<div class="x-body">
    <form class="layui-form form_single" action="{:url()}" method="post">


            <label for="shop_id" class="layui-form-label">
                <span class="x-red">*</span>商铺列表
            </label>
            <div class="layui-input-block">
                <select name="shop_id" id="shop_id" >
                    {volist name='shop_list' id='vo'}
                    <option value="{$vo['id']}">{$vo['shop_name']}</option>
                    {/volist}
                </select>
            </div>
            <div class="layui-form-mid layui-word-aux">
                (商铺列表)
            </div>

</div>





        <div class="box-footer">

            <input type="hidden" name="id" value="{$param['id']|default='0'}"/>

            <button type="button"  class="layui-btn ladda-button" data-style="slide-up"  onclick="save()">
                确 定
            </button>
            <a class="layui-btn ladda-button" onclick="javascript:cancel();return false;"><i class="fa fa-history"></i> 取 消</a>


        </div>

    </form>
</div>

<script>
    layui.use('laydate', function(){
        layer=layui.layer;
        //执行一个laydate实例
    });
    function save(){
        var id=$("[name='id']").val();
        var shop_name=$("[name='shop_id']").val();
        $.post("{:url('trade_check')}",{id:id,shop_id:shop_name,match:1},function (d) {
            if(d.code==1){

                layer.msg(d.msg);
                setTimeout( function () {
                    var index = parent.layer.getFrameIndex(window.name);
                    parent.layer.close(index);//关闭当
                    parent.location.reload();
                },2000);

            }else{
                layer.msg(d.msg);
            }
        })
    }

    function cancel() {

        var index = parent.layer.getFrameIndex(window.name);
        parent.layer.close(index);//关闭当
    }

</script>